home *** CD-ROM | disk | FTP | other *** search
/ Inside Multimedia 1994 April / Inside Multimedia CD-ROM (April 1994).iso / prg / gs / gssource.exe / GCONFIG.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-24  |  3.3 KB  |  102 lines

  1. /* Copyright (C) 1989, 1992 Aladdin Enterprises.  All rights reserved.
  2.    Distributed by Free Software Foundation, Inc.
  3.  
  4. This file is part of Ghostscript.
  5.  
  6. Ghostscript is distributed in the hope that it will be useful, but
  7. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. to anyone for the consequences of using it or for whether it serves any
  9. particular purpose or works at all, unless he says so in writing.  Refer
  10. to the Ghostscript General Public License for full details.
  11.  
  12. Everyone is granted permission to copy, modify and redistribute
  13. Ghostscript, but only under the conditions described in the Ghostscript
  14. General Public License.  A copy of this license is supposed to have been
  15. given to you along with Ghostscript so you can know your rights and
  16. responsibilities.  It should be in a file named COPYING.  Among other
  17. things, the copyright notice and this notice must be preserved on all
  18. copies.  */
  19.  
  20. /* gconfig.c */
  21. /* Installed device table for Ghostscript */
  22. #include "ghost.h"
  23. /*
  24.  * Since we only declare variables of type gx_device *,
  25.  * it should be sufficient to define struct gx_device_s as
  26.  * an abstract (undefined) structure.  However, the VAX VMS compiler
  27.  * isn't happy with this, so we have to include the full definition.
  28.  */
  29. #include "gxdevice.h"
  30. /*
  31.  * We generate an array of strings as a static structure:
  32.  */
  33. #define ref_(t) struct { struct tas_s tas; t value; }
  34. #define string_v(n,s)\
  35.  { {(t_string<<r_type_shift)+a_readonly, n}, s }
  36.  
  37. /*
  38.  * The Ghostscript makefile generates the file gconfig.h, which consists of
  39.  * lines of the form
  40.  *    device_(gs_xxx_device)
  41.  * for each installed device,
  42.  *    font_("0.font_xxx", font_xxx, zfont_xxx)
  43.  * for each compiled font,
  44.  *    oper_(xxx_op_defs)
  45.  * for each operator option, and
  46.  *    psfile_("gs_xxxx.ps")
  47.  * for each optional initialization file.
  48.  *
  49.  * We include this file multiple times to generate various different
  50.  * source structures.  (It's a hack, but we haven't come up with anything
  51.  * more satisfactory.)
  52.  */
  53.  
  54. /* Here is where the library search path and the name of the */
  55. /* initialization file are defined.  We supply defaults just in case */
  56. /* someone compiles the file without the proper command line flags. */
  57. #ifndef GS_LIB_DEFAULT
  58. #  define GS_LIB_DEFAULT ""
  59. #endif
  60. #ifndef GS_INIT
  61. #  define GS_INIT "gs_init.ps"
  62. #endif
  63. const char *gs_lib_default_path = GS_LIB_DEFAULT;
  64. const char *gs_init_file = GS_INIT;
  65.  
  66. /* Operators and fonts are handled in iinit.c and iccfont.c. */
  67. #define font_(fname, fproc, zfproc)
  68. #define oper_(defs)
  69. #define psfile_(fns)
  70.  
  71. /* Declare the devices as extern. */
  72. #define device_(dev) extern gx_device dev;
  73. #include "gconfig.h"
  74. #undef device_
  75.  
  76. /* Set up the device table. */
  77. #define device_(dev) &dev,
  78. gx_device *gx_device_list[] = {
  79. #include "gconfig.h"
  80.     0
  81. };
  82. #undef device_
  83. #define device_(dev)
  84.  
  85. /* Set up the .ps file name string array. */
  86. /* We fill in the lengths at initialization time. */
  87. #define ref_(t) struct { struct tas_s tas; t value; }
  88. #define string_(s)\
  89.  { {(t_string<<r_type_shift)+a_readonly, 0}, s },
  90. #undef psfile_
  91. #define psfile_(fns) string_(fns)
  92. ref_(const char *) gs_init_file_array[] = {
  93. #include "gconfig.h"
  94.     string_(0)
  95. };
  96.  
  97. /* Some C compilers insist on executable code here, so.... */
  98. void
  99. gconfig_dummy()
  100. {
  101. }
  102.